home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / cnet / ansi_pack.lha / TestDoor < prev   
Text File  |  1996-12-04  |  9KB  |  220 lines

  1. /**************************************************************************\
  2.             $VER: TEST Door, v0.00 (00-Jan-00) by Dotoran!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. ver=word(sourceline(2),4);a=word(sourceline(2),5);parse var a "("vdate")"
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;mg=maygetchar
  7. a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
  8. /***************************************************************************\
  9.       Insert your test code between the following two COMMENT Lines!
  10. \***************************************************************************/
  11.  
  12. a=random(,,time("s")) ; se "f1Hello"
  13. gu 27 ; cols=result ; gu 1100468 ; rows=result
  14. do forever until k="q" ; mg ; k=result
  15.   row=random(1,(rows%2)-5) ; col=random(1,(cols%2)-5)-1
  16.   co=substr("0123456789abcdef",random(1,16),1)
  17.   char=d2c(random(161,255)) ; a=random(1,5)
  18. do i=1 to a
  19.   se ""row+i";"col+i"Hc"co||char
  20.   se ""row+i";"cols-col-i"Hc"co||char
  21.   se ""rows-row-i";"col+i"Hc"co||char
  22.   se ""rows-row-i";"cols-col-i"Hc"co||char
  23. end i
  24. end ; tr "1HGood Bye!"
  25. exit
  26.  
  27.  
  28.  
  29.   gu 3 ; realname=result  ; gu 6 ; street=result
  30.   gu 4 ; citystate=result ; gu 5 ; zip=result
  31.   kb.1="     Real Name:"  ; kb.2="Street Address:"
  32.   kb.3="   City, State:"  ; kb.4="      Zip Code:"
  33.   tr "f1z4c7 Simple AnsiARexx VDE Editor z0n1"
  34.   tr "z4c7     Real Name:z0 c3"realname
  35.   tr "z4c7Street Address:z0 c3"street
  36.   tr "z4c7   City, State:z0 c3"citystate
  37.   tr "z4c7      Zip Code:z0 c3"zip
  38.   kb=1 ; kbt=4 ; save=0
  39. EDIT:
  40.   se ""kb+2";1Hz7c4"kb.kb"z0q1"
  41.   do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
  42.   if c2d(k)=27 then do 2 ; mg ; kk=result ; end
  43.   if c2d(k)=27 & kk="NOCHAR" then signal SAVE
  44.   se ""kb+2";Hz4c7"kb.kb"z0"
  45.   if kk="A" then do ; kb=kb-1 ; if kb<1 then kb=kbt ; end
  46.   if kk="B" then do ; kb=kb+1 ; if kb>kbt then kb=1 ; end
  47.   if c2d(k)=13 then do
  48.     if kb=1 then do ; se ""kb+2";17Hz3L1305640 #"realname"}s"
  49.       se left("",34)"uz3c4I20 34}";gu 70;a=result;save=(a~=realname)
  50.       se "z0c3u"left(a,34);realname=a;signal EDIT;end
  51.     if kb=2 then do ; se ""kb+2";17Hz3L1305640 #"street"}s"
  52.       se left("",30)"uz3c4I20 30}";gu 70;a=result;save=(a~=street)
  53.       se "z0c3u"left(a,30);street=a;signal EDIT;end
  54.     if kb=3 then do ; se ""kb+2";17Hz3L1305640 #"citystate"}s"
  55.       se left("",22)"uz3c4I20 22}";gu 70;a=result;save=(a~=citystate)
  56.       se "z0c3u"left(a,22);citystate=a;signal EDIT;end
  57.     if kb=4 then do ; se ""kb+2";17Hz3L1305640 #"zip"}s"
  58.       se left("",10)"uz3c4I20 10}";gu 70;a=result;save=(a~=zip)
  59.       se "z0c3u"left(a,10);zip=a;signal EDIT;end
  60.   end
  61.  signal EDIT
  62. SAVE:
  63.   if save=0 then tr "1HNo changes made... Exiting..." 
  64.    else tr "1HChanges Made! Data automatically SAVED, then exit..."
  65.  exit
  66.  
  67.   gu 3 ; realname=result  ; gu 6 ; street=result
  68.   gu 4 ; citystate=result ; gu 5 ; zip=result
  69.   kb.1="     Real Name:"  ; kb.2="Street Address:"
  70.   kb.3="   City, State:"  ; kb.4="      Zip Code:"
  71.   tr "f1z4c7 Simple AnsiARexx VDE Editor z0n1"
  72.   tr "z4c7     Real Name:z0 c3"realname
  73.   tr "z4c7Street Address:z0 c3"street
  74.   tr "z4c7   City, State:z0 c3"citystate
  75.   tr "z4c7      Zip Code:z0 c3"zip
  76.   kb=1 ; kbt=4
  77. EDIT:
  78.   se ""kb+2";1Hz7c4"kb.kb"z0q1"
  79.   do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
  80.   if c2d(k)=27 then do 2 ; mg ; kk=result ; end
  81.   if c2d(k)=27 & kk="NOCHAR" then do ; tr "1HExiting..." ; exit ; end
  82.   se ""kb+2";Hz4c7"kb.kb"z0"
  83.   if kk="A" then do ; kb=kb-1 ; if kb<1 then kb=kbt ; end
  84.   if kk="B" then do ; kb=kb+1 ; if kb>kbt then kb=1 ; end
  85.   if c2d(k)=13 then do
  86.     if kb=1 then do ; se ""kb+2";17Hr1c3L1305640 #"realname"}I20 34}"
  87.       gu 70;realname=result;signal EDIT;end
  88.     if kb=2 then do ; se ""kb+2";17Hr1c3L1305640 #"street"}I20 30}"
  89.       gu 70;street=result;signal EDIT;end
  90.     if kb=3 then do ; se ""kb+2";17Hr1c3L1305640 #"citystate"}I20 22}"
  91.       gu 70;citystate=result;signal EDIT;end
  92.     if kb=4 then do ; se ""kb+2";17Hr1c3L1305640 #"zip"}I20 10}"
  93.       gu 70;zip=result;signal EDIT;end
  94.   end
  95.  signal EDIT
  96.  
  97.     tr "f1.--.--.--.--.--.--.--.--.--.--."
  98.   do 9;tr "|  |  |  |  |  |  |  |  |  |  |"
  99.        tr "|--+--+--+--+--+--+--+--+--+--|";end
  100.        tr "|  |  |  |  |  |  |  |  |  |  |"
  101.        tr "`--^--^--^--^--^--^--^--^--^--'"
  102.                   row=1 ; col=1
  103. MOVE:
  104.   se ""row*2";"col*3-1"H>"
  105.   do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
  106.   if c2d(k)=27 then do 2 ; mg ; kk=result ; end
  107.   if c2d(k)=27 & kk="NOCHAR" then do ; se "1HExiting..." ; exit ; end
  108.   if c2d(k)=13 then do ; se ""row*2";"col*3"H#" ; signal MOVE ; end
  109. /*
  110.   if c2d(k)=13 then do ; se "1HRow: "row", Column: "col ; exit ; end
  111. */
  112.   tr ""row*2";"col*3-1"H "
  113.   if k="8" | kk="A" then do ; row=row-1 ; if row<1 then row=10 ; end
  114.   if k="2" | kk="B" then do ; row=row+1 ; if row>10 then row=1 ; end
  115.   if k="6" | kk="C" then do ; col=col+1 ; if col>10 then col=1 ; end
  116.   if k="4" | kk="D" then do ; col=col-1 ; if col<1 then col=10 ; end
  117.  signal MOVE
  118.  
  119.     tr "f1.--.--.--.--.--.--.--.--.--.--."
  120.   do 9;tr "|  |  |  |  |  |  |  |  |  |  |"
  121.        tr "|--+--+--+--+--+--+--+--+--+--|";end
  122.        tr "|  |  |  |  |  |  |  |  |  |  |"
  123.        tr "`--^--^--^--^--^--^--^--^--^--'"
  124.                   row=1 ; col=1
  125. MOVE:
  126.   se ""row*2";"col*3-1"H>"
  127. /*
  128.   se ""row*2";"col*3-1"H"
  129. */
  130.   do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
  131.   if c2d(k)=27 then do 2 ; mg ; kk=result ; end
  132. /*
  133.   se ""row*2";"col*3-1"H"
  134.   gc ; k=result ; kk="" ; if c2d(k)=27 then do 2 ; mg ; kk=result ; end
  135.   if c2d(k)=27 & kk="NOCHAR" then do ; se "1HExiting..." ; exit ; end
  136. */
  137.   if c2d(k)=13 then do ; se "1HRow: "row", Column: "col ; exit ; end
  138.   tr ""row*2";"col*3-1"H "
  139.   if k="8" | kk="A" then do ; row=row-1 ; if row<1 then row=10 ; end
  140.   if k="2" | kk="B" then do ; row=row+1 ; if row>10 then row=1 ; end
  141.   if k="6" | kk="C" then do ; col=col+1 ; if col>10 then col=1 ; end
  142.   if k="4" | kk="D" then do ; col=col-1 ; if col<1 then col=10 ; end
  143. /*
  144.   if kk="A" then do ; row=row-1 ; if row<1 then row=10 ; end
  145.   if kk="B" then do ; row=row+1 ; if row>10 then row=1 ; end
  146.   if kk="C" then do ; col=col+1 ; if col>10 then col=1 ; end
  147.   if kk="D" then do ; col=col-1 ; if col<1 then col=10 ; end
  148.   if kk="A" & row>1  then row=row-1
  149.   if kk="B" & row<10 then row=row+1
  150.   if kk="C" & col<10 then col=col+1
  151.   if kk="D" & col>1  then col=col-1
  152. */
  153.  signal MOVE
  154.  
  155. KEYS2:
  156.   tr "Press some keys now..."
  157.   do forever until k="Q"
  158.     gc ; k=result ; kk="" ; if c2d(k)=27 then do 2 ; gc ; kk=result ; end
  159.     select
  160.       when c2d(k)=27 & kk="" then tr "You pressed the ESCape key..."
  161.       when kk="A"     then tr "You pressed the UP cursor arrow..."
  162.       when kk="B"     then tr "You pressed the DOWN cursor arrow..."
  163.       when kk="C"     then tr "You pressed the RIGHT cursor arrow..."
  164.       when kk="D"     then tr "You pressed the LEFT cursor arrow..."
  165.       when c2d(k)=13  then tr "You pressed the ENTER key..."
  166.       when c2d(k)=9   then tr "You pressed the TAB key..."
  167.       when c2d(k)=127 then tr "You pressed the DELETE key..."
  168.       when c2d(k)=8   then tr "You pressed the BACKSPACE key..."
  169.       when c2d(k)=32  then tr "You pressed the SPACEBAR key..."
  170.       otherwise tr "You pressed the "k" key..."
  171.     end
  172.   end
  173.  exit
  174.  
  175. KEYS1:
  176.   tr "Press some keys now..."
  177.   do forever until k="q"
  178.     mg ; k=result ; kk="" ; if k="NOCHAR" then iterate
  179.     if c2d(k)=27 then do 2 ; mg ; kk=result ; end
  180.     select
  181.       when c2d(k)=27 & kk="NOCHAR" then tr "You pressed the ESCape key..."
  182.       when kk="A"     then tr "You pressed the UP cursor arrow..."
  183.       when kk="B"     then tr "You pressed the DOWN cursor arrow..."
  184.       when kk="C"     then tr "You pressed the RIGHT cursor arrow..."
  185.       when kk="D"     then tr "You pressed the LEFT cursor arrow..."
  186.       when c2d(k)=13  then tr "You pressed the ENTER key..."
  187.       when c2d(k)=9   then tr "You pressed the TAB key..."
  188.       when c2d(k)=127 then tr "You pressed the DELETE key..."
  189.       when c2d(k)=8   then tr "You pressed the BACKSPACE key..."
  190.       when c2d(k)=32  then tr "You pressed the SPACEBAR key..."
  191.       otherwise tr "You pressed the "k" key..."
  192.     end
  193.   end
  194.  exit
  195.   
  196. START2:
  197.   se "Press any key now(press Q to quit): "
  198.   do until k~="NOCHAR" ; mg ; k=result ; end
  199.   tr c2d(k) ; if k="q" then exit
  200.  signal START2
  201.  
  202. START:
  203.   se "Press any key now(press Q to quit): "
  204.   gc ; k=result ; tr k
  205.   if k="Q" then exit
  206.  signal START
  207.  
  208. /***************************************************************************/
  209. exit
  210. CHECK:;if ARG() & ARG(1)~='###PANIC' then return ARG(1)
  211.   getcarrier;if result='TRUE' then if ARG() then return ARG(1);else return
  212.   logentry 'Lost Carrier!!';bufferflush;exit
  213. SYNTAX:;ERROR:;IOERR:;e1='n1 Error: 'rc' ('errortext(rc)')'
  214.   e2='  Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960
  215.   b=result;c='"'a||b', 'ver'"';e2=e2' 'c;tr e1;tr e2;logentry e1
  216.   logentry e2;e=translate(sourceline(sigl),"\{","");do while e~=''
  217.   e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush
  218. /**************************************************************************\
  219. \****************************************** Frontiers BBS (716)/823-9892 **/
  220.